-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs(directive): Clarified and cleaned up directive guide #2888
Conversation
@@ -63,7 +63,7 @@ api/ng.$rootScope.Scope#$digest digest} cycle. An example of interpolation is sh | |||
here: | |||
|
|||
<pre> | |||
<a href="img/{{username}}.jpg">Hello {{username}}!</a> | |||
<a ng-href="img/{{username}}.jpg">Hello {{username}}!</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
@ProLoser - can you take a look at my comments and rework this PR? Thanks. |
* `?` - Don't raise an error. This makes the require dependency optional. | ||
* `^` - Look for the controller on parent elements as well. | ||
* `?` - Required dependency is optional. The parameter might be `null/undefined`. | ||
* `^` - Look for the directive on parent/ancestor elements as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the ^?
case should also be explicitly added here as (to me) it wasn't clear that both modifier could be specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually add a note above or below the bulleted items and not as an explicit item in the list. However re-reading my description, I think "Required dependency is optional" couldn't be any more confusing lol.
@ProLoser - is this ready to be reviewed now? |
@ProLoser - surely you have signed the CLA at some point? |
PR Checklist (Docs-only fix)
|
Rebased. |
- corrected terminology about how directives use `require` - added more variations to the DirectiveDefinitionObject - removed some slightly superfluous text docs(directive): Minor correction to example to avoid bad practice Anchor tags should use `ng-href` instead of `href` for interpolation. docs(directive): Supplementing DDO description DDO = Directive Definition Object Tweak recommended here: https://github.com/angular/angular.js/pull/2888/files#r4664565
Squashed |
As 454bcfa |
require